package cate.common.table.d;

import cate.common.table.common.ParamSheet;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

import java.util.ArrayList;
import java.util.List;

@NoteClass(value = "星格")
public class GDSpice {

    @NoteClass(value = "星格-星格类型")
    public static final class Type {
        @NoteField(value = "经验星格")
        public static final byte T0 = 0;

        @NoteField(value = "属性星格")
        public static final byte T1 = 1;
    }

    @NoteClass(value = "星格-星格洗练")
    public static final class Scour {
        @NoteField(value = "星格洗练锁定属性的元宝消耗")
        private static List<String> LOCK_ATTR_M1_COST;

        /** 根据洗练锁定属性个数获取元宝消耗 */
        public static String getM2Cost(int lockNum) {
            if (Scour.LOCK_ATTR_M1_COST == null
                    || Scour.LOCK_ATTR_M1_COST.size() == 0
                    || lockNum < 0) {
                return null;
            }
            if (lockNum > Scour.LOCK_ATTR_M1_COST.size()) {
                return Scour.LOCK_ATTR_M1_COST.get(Scour.LOCK_ATTR_M1_COST.size() - 1);
            }
            return Scour.LOCK_ATTR_M1_COST.get(lockNum - 1);
        }
    }

    public static int DIF_GROUP_DAY;

    /** 读取excel中配置的参数 */
    public static void initialize(ParamSheet paramSheet) {
        Scour.LOCK_ATTR_M1_COST = new ArrayList<>();
        String[] scour_M2_Array = GDParamTool.getString(paramSheet,801, "0:1:50#0:1:200").split("#");
        for (String str : scour_M2_Array) {
            Scour.LOCK_ATTR_M1_COST.add(str);
        }
        DIF_GROUP_DAY = GDParamTool.getInt(paramSheet, 130007, 7);
    }
}
